package com.cc.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class FileUtils {

    public static byte[] readFileToByteArray(File file) {
        InputStream is = null;
        byte[] buffer = null;
        try {
            is = new FileInputStream(file);
            buffer = new byte[is.available()];
            is.read(buffer);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return buffer;
      
    }

}
